package com.yrot.common.result;

/**
 * Created by hemin on 2018/11/15.
 */
public class ResultUtils {

    public static Result success(Long count,Object data){
        Result result = new Result();
        result.setCode(0000);
        result.setMsg("成功");
        result.setCount(count);
        result.setData(data);
        return result;
    }

    public static Result success(){
        return success(new Long(0),null);
    }

    public static Result error(ResultEnum resultEnum){
        Result result = new Result();
        result.setCode(resultEnum.getCode());
        result.setMsg(resultEnum.getMsg());
        return result;
    }

    public static Result error(Integer code,String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
